<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="keywords" content="关键字"/>
    <meta name="description" content="设置页面的说明"/>
    <meta name="generator" content="EditPlus"/>
    <meta name="author" content="thelongmarch"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script src="jquery.js" type="text/javascript"></script>
    <!--
    页面刷新
    <meta http-equiv="refresh" content="10" url="index.html"/>
    -->
    <title>无标题文档</title>
    <style>
        .main{
            width:100%;
            height:2000px;
            background-color:#CCCC33 ;
            border:1px solid red;
        }
    </style>
</head>

<body>
<div class="main">
</div>
<script type="text/javascript">

    (function ($) {
        $.fn.snow = function (options) {
            var $flake = $('<div id="flake" />').css({'position': 'absolute', 'top': '-50px'}).html('&#10052;'),
                documentHeight = $(document).height(), documentWidth = $(document).width(),
                //documentHeight = 1920, documentWidth = 1024,
                defaults = {minSize: 10, maxSize: 20, newOn: 500, flakeColor: "#F7F7F7"},
                options = $.extend({}, defaults, options);
            var interval = setInterval(function () {
                var startPositionLeft = Math.random() * documentWidth - 100, startOpacity = 0.5 + Math.random(),
                    sizeFlake = options.minSize + Math.random() * options.maxSize,
                    endPositionTop = documentHeight - 40,
                    endPositionLeft = startPositionLeft - 100 + Math.random() * 200,
                    durationFall = documentHeight * 10 + Math.random() * 5000;
                $flake.clone().appendTo('body').css({
                    left: startPositionLeft,
                    opacity: startOpacity,
                    'font-size': sizeFlake,
                    color: options.flakeColor
                }).animate({
                    top: endPositionTop,
                    left: endPositionLeft,
                    opacity: 0.2
                }, durationFall, 'linear', function () {
                    $(this).remove()
                });
            }, options.newOn);
        };
    })(jQuery);
    $.fn.snow({minSize: 25, maxSize: 60, newOn: 1000, flakeColor: '#F7F7F7'});

</script>
</body>
</html>